package com.lzp.copyui.rv

import android.os.Bundle
import androidx.recyclerview.widget.LinearLayoutManager
import com.base.BaseActivity
import com.lzp.copyui.databinding.SnapHelperActivityBinding

/**
 * @describe:
 * @Author: lixiaopeng
 * @Date: 2/26/21
 */
class SnapHelperActivity : BaseActivity() {

    private val binding: SnapHelperActivityBinding by lazy { SnapHelperActivityBinding.inflate(layoutInflater) }
    private val adapter = SnapHelperAdapter()
    private val snapHelper = CountSnapHelper()

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(binding.root)
    }

    override fun initView() {
        super.initView()
        binding.rv.layoutManager = LinearLayoutManager(this, LinearLayoutManager.HORIZONTAL, false)
        binding.rv.adapter = adapter
        snapHelper.attachToRecyclerView(binding.rv)
    }

}